package net.valerijtimakov.homefinances.dao.providers;

import net.valerijtimakov.homefinances.dao.storages.finances.mysql.IMySqlProvider;
import net.valerijtimakov.homefinances.dao.storages.finances.mysql.IMySqlProviderFactory;
import net.valerijtimakov.homefinances.exceptions.AppPersProviderException;

public class MySqlProviderFactory implements IMySqlProviderFactory {
	
	private String hostName; 
	private String dbName; 
	private String user; 
	private String password;

	public MySqlProviderFactory() {
		super();
	}

	public MySqlProviderFactory(String hostName, String dbName, String user, String password) {
		super();
		this.hostName = hostName;
		this.dbName = dbName;
		this.user = user;
		this.password = password;
	}

	public void setHostName(String hostName) {
		this.hostName = hostName;
	}

	public void setDbName(String dbName) {
		this.dbName = dbName;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public IMySqlProvider getProvider() throws AppPersProviderException {
		return new MySqlProvider(hostName, dbName, user, password);
	}

}
